﻿#include "FITKLoadConstraintSEAAcoustic.h"
#include "FITKAcousticsAbstractSpectra.h"
#include "FITK_Kernel/FITKCore/FITKDataRepo.h"

namespace Acoustics
{
    FITKLoadConstraintSEAAcoustic::FITKLoadConstraintSEAAcoustic()
    {
        //构造
    }

    FITKLoadConstraintSEAAcoustic::~FITKLoadConstraintSEAAcoustic()
    {
        //析构
    }

    FITKAcousticsAbstractLoad::AcousticsLoadType FITKLoadConstraintSEAAcoustic::getAcousticsLoadType()
    {
        //获取载荷类型
        return FITKAcousticsAbstractLoad::AcousticsLoadType::ConstraintSEAAcoustic;
    }

    bool FITKLoadConstraintSEAAcoustic::copy(FITKAbstractDataObject* obj)
    {
        //拷贝数据 
        FITKLoadConstraintSEAAcoustic* oldObj = dynamic_cast<FITKLoadConstraintSEAAcoustic*>(obj);
        if (!oldObj) return false;
        _enabledState = oldObj->_enabledState;
        _notes = oldObj->_notes;
        _connectObjID = oldObj->_connectObjID;
        _spectraID = oldObj->_spectraID;
        this->Core::FITKAbstractNDataObject::copy(obj);
        return true;
    }

    void FITKLoadConstraintSEAAcoustic::setSpectraDataID(int spectraID)
    {
        //设置频谱ID
        _spectraID = spectraID;
    }

    int FITKLoadConstraintSEAAcoustic::getSpectraDataID()
    {
        //获取频谱ID
        return _spectraID;
    }

    FITKAcousticsAbstractSpectra* FITKLoadConstraintSEAAcoustic::getSpectraDataObj()
    {
        //获取频谱对象
        return FITKDATAREPO->getTDataByID<FITKAcousticsAbstractSpectra>(_spectraID);
    }
}